<?php

function about_tamilnadu_data(){
global $base_url;
global $language;
//print_r($language);

if($language->language=='ta')
	$lang = 'ta';
else
	$lang = 'en';


  	$modPath = drupal_get_path('module', 'about_tamilnadu');
	 $url = $base_url . '/' . drupal_get_path('module', 'about_tamilnadu');
	//commented for testing
//drupal_set_title("<div class='titleview'>".SITE_STATE."</div>");
drupal_set_title(t(SITE_STATE));
$output ="<div></div>";
my_db_change(1);
$query = new EntityFieldQuery();
	$query->entityCondition('entity_type', 'node')
	  ->entityCondition('bundle', 'profile_state')
	  ->propertyCondition('status',1)
	  ->propertyCondition('language', array($GLOBALS['language']->language, LANGUAGE_NONE), 'IN');

	$result = $query->execute();

	if (isset($result['node'])) {
      $news_items_nids = array_keys($result['node']);
      $nid = current($news_items_nids);
      $vid = db_query('SELECT vid FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetchField();
      $statedata = node_load($nid, $vid);
	}
//print "<pre>";print_r($result);print "</pre>";
if(count($statedata)){
$baseurl= BASECH;
$strData = '<div style="float:left;width:220px;"><img src="'.$base_url.'/sites/default/files/tamilnadu1.jpg" />
</div>
<div style="float:left;width:296px;">
	<div class="state_profile_heading" ><strong>'.t("Particulars").'</strong></div>
	<div class="state_profile_heading1" ><strong>'.t("Description").'</strong></div>
	<div class="state_profile"><div class="img_class"><img src="'.$base_url.'/sites/default/files/know_area.gif" style="border:0px solid #999999; vertical-align:middle" /></div>'.t("Area").'</div>
	<div class="state_profile">'.$statedata->title.'</div>
	<div class="state_profile"><div class="img_class"><img src="'.$base_url.'/sites/default/files/know_population.gif" style="border:0px solid #999999;vertical-align:middle"/></div>'.t("Population").'</div>
	<div class="state_profile">'.$statedata->field_tn_population['und'][0]['value'].'</div>
	<div class="state_profile"><div class="img_class"><img src="'.$base_url.'/sites/default/files/know_capital.gif" style="border:0px solid #999999;vertical-align:middle"/></div>'.t("Capital").'</div>
	<div class="state_profile">'.$statedata->field_tn_capital['und'][0]['value'].'</div>
	<div class="state_profile"><div class="img_class"><img src="'.$base_url.'/sites/default/files/know_language.gif" style="border:0px solid #999999;vertical-align:middle"/></div>'.t("Language").'</div>
	<div class="state_profile">'.$statedata->field_tn_languages['und'][0]['value'].'</div>
</div>
<div  style="clear:both"></div>
';
 if($statedata->field_tn_history_geography['und'][0]['value'] !=''){
	$strData .='	<div class="profile_form_div" style="border-bottom:none"><p class="about_tamil" >'.t("History And Geography").'</p><br /><span id="profile_form">'.$statedata->field_tn_history_geography['und'][0]['value'].'</span></div> <div class="clr"></div>';
 }
if($statedata->field_tn_administrative_units['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"  ><p class="profile_form1" style="margin-bottom:0.5em;margin-top:5px;" >'.t("Administrative units of state").'</p>
		<span id="profile_form" style="margin-bottom:20px;float:left;">
		 <div id="abt_tn">
		'.$statedata->field_tn_administrative_units['und'][0]['value'].'
		<div class="clr"></div> </div>
		 </span>
		</div> <div class="clr"></div>';
	 }

	if($statedata->field_tn_peopleculture['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("People & Culture").'</p><span id="profile_form">'.$statedata->field_tn_peopleculture['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }
	 if($statedata->field_tn_education['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Education & Literacy").'</p><span id="profile_form">'.$statedata->field_tn_education['und'][0]['value'].'</span></div> <div class="clr"></div>';
	}
	 if($statedata->field_tn_health['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Health").'</p><span id="profile_form">'.$statedata->field_tn_health['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }
	if($statedata->field_tn_agriculture['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Agriculture").'</p><span id="profile_form">'.$statedata->field_tn_agriculture['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }
	if($statedata->field_tn_industry_minerals['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Industry and Minerals").'</p><span id="profile_form">'.$statedata->field_tn_industry_minerals['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }
	if($statedata->field_tn_irrigation['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Irrigation").'</p><span id="profile_form">'.$statedata->field_tn_irrigation['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }
		if($statedata->field_tn_power['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Power").'</p><span id="profile_form">'. $statedata->field_tn_power['und'][0]['value'].'</span></div> <div class="clr"></div>';
	}
	 if($statedata->field_tn_transport['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Transport").'</p><span id="profile_form">'.$statedata->field_tn_transport['und'][0]['value'].'</span></div> <div class="clr"></div>';
 }
	if($statedata->field_tn_communications['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("communication").'</p><span id="profile_form">'.$statedata->field_tn_communications['und'][0]['value'].'</span></div> <div class="clr"></div>';
 }
	 if($statedata->field_tn_festivals['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Festivals").'</p><span id="profile_form">'. $statedata->field_tn_festivals['und'][0]['value'].'</span></div> <div class="clr"></div>';
	 }

	 if($statedata->field_tn_tourist_centres['und'][0]['value'] !=''){
		$strData .='<div class="profile_form_div"><p class="about_tamil" >'.t("Tourist Centres").'</p><span id="profile_form">'.$statedata->field_tn_tourist_centres['und'][0]['value'].'</span></div> <div class="clr"></div>';
 }
}

my_db_change(0);
return $strData;
}


?>